home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / AppleScript / QUICKTIME 5.0.2 SCRIPTS / Script Templates / QT 5 Player Template < prev    next >
Encoding:
Text File  |  2001-06-26  |  1.6 KB  |  54 lines

  1. tell application "QuickTime Player"
  2.     activate
  3.     
  4.     stop every movie
  5.     
  6.     try
  7.         -- CHECK FOR THE CORRECT VERSION OF QUICKTIME
  8.         set the QT_version to (the QuickTime version as string)
  9.         set the player_version to (the version as string)
  10.         set the required_version to "5.0.2"
  11.         if (the QT_version is less than the required_version) or ¬
  12.             (the player_version is less than the required_version) then
  13.             set the error_message to "This script requires QuickTime " & the required_version & "  or greater." & ¬
  14.                 return & return & ¬
  15.                 "Current QuickTime Version: " & QT_version & return & ¬
  16.                 "Current QuickTime Player Version: " & player_version
  17.             my upgrade_QT(error_message)
  18.         end if
  19.         
  20.         -- CHECK FOR QUICKTIME PRO
  21.         if QuickTime Pro installed is false then
  22.             set the error_message to "This script requires a QuickTime Pro installation on this system."
  23.             my upgrade_QT(error_message)
  24.         end if
  25.         
  26.         -- SCRIPT STATEMENTS GO HERE
  27.         
  28.         
  29.         
  30.     on error error_message number error_number
  31.         if the error_number is not -128 then
  32.             beep
  33.             display dialog error_message buttons {"Cancel"} default button 1
  34.         end if
  35.     end try
  36. end tell
  37.  
  38. on upgrade_QT(passed_message)
  39.     tell application "QuickTime Player"
  40.         activate
  41.         stop every movie
  42.         set the target_URL to "http://www.apple.com/quicktime/download/"
  43.         display dialog passed_message & return & return & ¬
  44.             "If this computer is currently connected to the Internet, " & ¬
  45.             "click the “Upgrade” button to visit the QuickTime Website." buttons {"Upgrade", "Cancel"} default button 2
  46.         ignoring application responses
  47.             tell application "Finder"
  48.                 open location target_URL
  49.             end tell
  50.         end ignoring
  51.         error number -128
  52.     end tell
  53. end upgrade_QT
  54.